<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/tld/importTag.tld" prefix="importTag"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://www.yaodian100.com/jsp/yaodian100" prefix="yaodian100" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@page import="org.apache.commons.lang.math.RandomUtils"%>
<c-rt:set var="frontContentPath" value='<%=ServerValue.getFrontContextPath()%>'/>
<link rel="stylesheet" href="/css/yaodian100_news.css" type="text/css" media="screen,print" />
<!-- javascript end -->
<body>
<c-rt:set var="now" value="<%=new java.util.Date()%>" />
<c-rt:if test="${orderByDate=='desc' or orderByDate == 'desc'}">
	<c-rt:set var="nextOrderByDate" value="asc"/>
</c-rt:if>
<c-rt:if test="${orderByDate=='asc' or orderByDate == 'asc'}">
	<c-rt:set var="nextOrderByDate" value="desc"/>
</c-rt:if>
<div class="s-location"><a href="${frontContentPath}/">首页</a> &gt; 最新快报</div>
  <div id="main">
  <div class="lcontainer">
  	   <a href="/act/allevent/eventlist.html"><img src="/act/allevent/images/banner.jpg" alt="全场优惠活动" width="193" height="403" /></a>
  </div>
  <div class="rcontainer">
	<h1 class="newstitle">最新快报</h1>
    <div class="pages-top">共${announcementSize}笔： ${pager.currentPage+1}/${pager.pageSize}
    <c-rt:choose><c-rt:when test="${pager.currentPage==0}">
		<span class="a-no">&lt; 上一页</span> |
	</c-rt:when><c-rt:otherwise>
		<a href="${frontContentPath}/announcement/listAll.do?orderByDate=${orderByDate}&pager.currentPage=${pager.currentPage-1}">&lt; 上一页</a> |
	</c-rt:otherwise></c-rt:choose>
	<c-rt:choose><c-rt:when test="${pager.currentPage == pager.pageSize-1}">
		<span class="a-no">下一页 &gt;</span>
	</c-rt:when><c-rt:otherwise>
		<a href="${frontContentPath}/announcement/listAll.do?orderByDate=${orderByDate}&pager.currentPage=${pager.currentPage+1}">下一页 &gt;</a>
	</c-rt:otherwise></c-rt:choose>
	</div>
    <div class="newslist-wrap">

      <table border="0" cellpadding="0" cellspacing="0" class="newslist-table">
      <tbody>
      	<tr class="newslist-title">
          <th class="newslist-num">&nbsp;</th>
          <th class="newslist-ititle">快報标题</th>
          <th <c-rt:if test="${orderByDate=='asc' }">class="newslist-podated"</c-rt:if><c-rt:if test="${orderByDate=='desc' }">class="newslist-podate"</c-rt:if>><a href="${frontContentPath}/announcement/listAll.do?orderByDate=${nextOrderByDate}">发布时间</a></th>
        </tr>
        <c-rt:set var="count" value="${pager.currentPage*10}" />
        <c-rt:forEach items="${announcementList}" var="announcement">
        <c-rt:set var="count" value="${count+1}" />
        <tr>
          <td class="newslist-num"><fmt:formatNumber value="${count}" pattern="00"/></td>
          <td>
          	<c-rt:choose>
          	<c-rt:when test="${announcement.endDate > now}">
          		<a href="<c-rt:if test="${not empty announcement.targetURL}">${announcement.targetURL}</c-rt:if><c-rt:if test="${empty announcement.targetURL}">${frontContentPath}/announcement/viewv2.do?annId=${announcement.id}</c-rt:if>" target="_blank">${announcement.subject}</a>
          	</c-rt:when><c-rt:otherwise>
				${announcement.subject}
			</c-rt:otherwise>
          	</c-rt:choose>
          </td>
          <td><fmt:formatDate value="${announcement.startDate}" pattern="yyyy-MM-dd"/></td>
        </tr>
        </c-rt:forEach>
        </tbody>
      </table>
    </div>
    <div class="pages-bottom">
        <span><yaodian100:pager10 pagerObj="${pager}" link="${frontContentPath}/announcement/listAll.do?orderByDate=${orderByDate}"/></span>
      </div>
      <div class="goback"><a href="/act/allevent/eventlist.html"> >> 全场优惠活动</a></div>
  </div>

  </div>

</body>